/**
 * Copyright (C) 2013-2014 the original author or authors.
 */
package com.foreveross.bsl.system.application;

import java.util.List;

import javax.ws.rs.DELETE;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.foreveross.bsl.system.application.vo.ApplicationRegisterVO;


/**
 * @description
 *
 * @author rening
 * @version v1.0
 *
 * @2013-6-7
 *
 */
@Path(value = "/applicationRegister")
public interface ApplicationRegisterApplication {

	@POST
	@Path("/")
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
	public ApplicationRegisterVO saveEntity(ApplicationRegisterVO entity);

	@POST
	@Path("/appKey")
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
	public String generateAppKey(@FormParam("accountId") String accountId, @FormParam("username") String username, @FormParam("appId")String appId, @FormParam("appName")String appName, @FormParam("appDesc")String appDesc, @FormParam("appStatus")String appStatus);

	@PUT
	@Path("/{id}")
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
	public ApplicationRegisterVO updateEntity(@PathParam("id") String id, ApplicationRegisterVO entity);

	@DELETE
	@Path("/{id}")
	public void deleteEntity(@PathParam("id") String id);

	@GET
	@Path("/fieldAppKey/{appKey}")
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
	public ApplicationRegisterVO getByAppKey(@PathParam("appKey") String appKey);

	@GET
	@Path("/findAppId/{appKey}")
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
	public String getAppIdByAppKey(@PathParam("appKey") String appKey);
	
	@GET
	@Path("/findAppKey/{appKey}")
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
	public String getAppKeyByAppId(@PathParam("appKey") String appId);
	
	@GET
	@Path("/{id}")
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
	public ApplicationRegisterVO getEntity(@PathParam("id") String id);
	
	@GET
	@Path("/")
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
	public List<ApplicationRegisterVO> findAll();

	@POST
	@Path("/pages")
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
	public Page<ApplicationRegisterVO> findByPageable(Pageable pageable);
	
}
